#region Copyright

// The contents of this file are subject to the Mozilla Public License
//  Version 1.1 (the "License"); you may not use this file except in compliance
//  with the License. You may obtain a copy of the License at
//  
//  http://www.mozilla.org/MPL/
//  
//  Software distributed under the License is distributed on an "AS IS"
//  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
//  License for the specific language governing rights and limitations under 
//  the License.
//  
//  The Initial Developer of the Original Code is Robert Smyth.
//  Portions created by Robert Smyth are Copyright (C) 2008.
//  
//  All Rights Reserved.

#endregion

using System;


namespace NUnit.Extensions.NUnitGridRunner
{
    public class ApplicationSettings : IApplicationSettings
    {
        private readonly bool gridTest;
        private readonly bool ignorePriorFailures;
        private readonly bool nowarn;
        private readonly TimeSpan runnerTimeLimit;
        private readonly TimeSpan runnerTimeLoading;
        private readonly string server;
        private readonly int serverPort;
        private readonly bool simulate;
        private readonly string[] testAssemblies;
        private readonly TimeSpan timeLimit;
        private readonly bool verbose;
        private readonly string workingDirectory;

        public ApplicationSettings(string server, int serverPort, string workingDirectory, string[] testAssemblies,
                                   bool verbose, TimeSpan timeLimit, TimeSpan runnerTimeLimit, bool simulate,
                                   bool ignorePriorFailures, bool gridTest, bool nowarn, TimeSpan runnerTimeLoading)
        {
            this.server = server;
            this.serverPort = serverPort;
            this.workingDirectory = workingDirectory;
            this.testAssemblies = testAssemblies;
            this.verbose = verbose;
            this.timeLimit = timeLimit;
            this.runnerTimeLimit = runnerTimeLimit;
            this.simulate = simulate;
            this.ignorePriorFailures = ignorePriorFailures;
            this.gridTest = gridTest;
            this.nowarn = nowarn;
            this.runnerTimeLoading = runnerTimeLoading;
        }

        public bool Verbose
        {
            get { return verbose; }
        }

        public string WorkingDirectory
        {
            get { return workingDirectory; }
        }

        public string[] TestAssemblies
        {
            get { return testAssemblies; }
        }

        public string Server
        {
            get { return server; }
        }

        public TimeSpan RunTimeLimit
        {
            get { return timeLimit; }
        }

        public int ServerPort
        {
            get { return serverPort; }
        }

        public bool Simulate
        {
            get { return simulate; }
        }

        public TimeSpan RunnerTimeLimit
        {
            get { return runnerTimeLimit; }
        }

        public bool IgnorePriorFailures
        {
            get { return ignorePriorFailures; }
        }

        public bool NetworkTestMode
        {
            get { return gridTest; }
        }

        public bool NoWarn
        {
            get { return nowarn; }
        }

        public TimeSpan RunnerTimeLoading
        {
            get { return runnerTimeLoading; }
        }
    }
}